import numpy as np
M=0.5
m=0.2
l=0.3
g=9.8
q1=q2=1
r=1
a=(M+m)*9.8/M/l
b=1/M/l
p2=(a*r+np.sqrt(a*a*r*r+b*b*q1)) / (b*b)
p4=np.sqrt((2*p2+q2)*r) / b
K1=-b*p2/r
K2=-b*p4/r
print(K1, K2)
